﻿<!-- Copyright (c) Lamey LLC, All rights reserved. Licensed under the Microsoft Public License (MS-PL). See LICENSE.TXT file in the project root directory for full license information. -->

<syswin:DraggableWindow
	x:Class="Lamey.Tools.CS.Sample.Views.MainWindow"
	
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:Lamey.Tools.CS.Sample.Views"
	xmlns:syswin="clr-namespace:System.Windows;assembly=CS.Net"
	xmlns:sysdraw="clr-namespace:System.Drawing;assembly=CS.Net"
	
	Width="300"
	Height="200"
	
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	mc:Ignorable="d">
	
    <syswin:DraggableWindow.Resources>
        <syswin:CollectionToVisibilityConverter x:Key="CollectionToVisibilityConverter"/>
    </syswin:DraggableWindow.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                <Image x:Name="HelloWorldIcon1"
					   Width="16" Height="16"
					   Source="{x:Static sysdraw:StockIcon.Users}" />
                <TextBlock x:Name="MessageTextBlock1"
						   Margin="6"
						   Text="Hello World!!!" />
                <Image x:Name="HelloWorldIcon2"
					   Width="16" Height="16"
					   Source="{x:Static sysdraw:StockIcon.Users}" />
			</StackPanel>
			
			<TextBlock x:Name="MessageTextBlock2"
					   Margin="6"
					   HorizontalAlignment="Center"
					   Text="Click the Run button for a surprise." />
		</StackPanel>

        <Grid Grid.Row="1">
			<ListView ItemsSource="{Binding MyDictionary}" DisplayMemberPath="Key" />
			<TextBlock Text="Oh, look at the time!"
					   HorizontalAlignment="Right" VerticalAlignment="Top"
					   Visibility="{Binding MyDictionary.Count, ConverterParameter=Any, Converter={StaticResource CollectionToVisibilityConverter}}" />
		</Grid>
		
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
			
			<!-- Run -->
            <Button x:Name="RunButton"
					Margin="6"
					Click="RunButton_Click">
                <StackPanel Orientation="Horizontal" Margin="6,0">
					<Image x:Name="ShieldIcon"
						   Width="16" Height="16"
						   Source="{x:Static sysdraw:StockIcon.Shield}" />
					<TextBlock Text="Run" />
				</StackPanel>
			</Button>
			
			<!-- Close -->
			<Button x:Name="CloseButton"
					Margin="6"
					Content="Close"
					Click="CloseButton_Click" Padding="6,0" />
        </StackPanel>
    </Grid>
</syswin:DraggableWindow>
